#ifndef _ACTORLOADER_H_
#define _ACTORLOADER_H_

#include <SECore/Ecs/Actor.h>

namespace SEngine
{
    class SceneLoader;
    class ActorLoader
    {
    public:
        ActorLoader(Actor & actor) : m_actor(actor) {}
        Actor & operator*() { return m_actor; }
        
        SceneLoader GetScene();

        template<typename T>
        T & GetComponent() {
            return m_actor.GetComponent<T>()->get();
        }

        template<typename T>
        bool HasComponent() {
            return m_actor.GetComponent<T>().has_value();
        }

        template<typename T>
        void AddComponent() {
            m_actor.AddComponent<T>();
        }

    private:
        Actor & m_actor;
    };
} // namespace SEngine


#endif